package com.miyake.client.datamanage;

import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;

public class NewColDialog extends DialogBox {

	public NewColDialog(int column) {
		setHTML("New Column Definition");
		
		VerticalPanel verticalPanel = new VerticalPanel();
		setWidget(verticalPanel);
		verticalPanel.setSize("100%", "100%");
		
		Label lblNewLabel_1 = new Label("Set column equation like \"C2-C1\"");
		verticalPanel.add(lblNewLabel_1);
		
		HorizontalPanel horizontalPanel = new HorizontalPanel();
		verticalPanel.add(horizontalPanel);
		
		Label lblNewLabel = new Label("C" + String.valueOf(column+1) + "=");
		horizontalPanel.add(lblNewLabel);
		
		TextBox textBox = new TextBox();
		horizontalPanel.add(textBox);
		
		HorizontalPanel horizontalPanel_1 = new HorizontalPanel();
		horizontalPanel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		verticalPanel.add(horizontalPanel_1);
		
		Button btnNewButton = new Button("New button");
		btnNewButton.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				hide(false);
			}
		});
		btnNewButton.setText("OK");
		horizontalPanel_1.add(btnNewButton);
		
		Button btnNewButton_1 = new Button("New button");
		btnNewButton_1.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				hide(true);
			}
		});
		btnNewButton_1.setText("Cancel");
		horizontalPanel_1.add(btnNewButton_1);
	}

}
